import { call, delay,all,put, takeEvery } from 'redux-saga/effects'
import * as types from "../store/action-types";

export function* helloSaga() {
  console.log("Hello Saga!");
}

export function* incrementAsync() {
  yield delay(1000)
  yield put({ type: types.MINUS2 })
}

export function* watchIncrementAsync() {
  yield takeEvery(types.MINUS2, incrementAsync)
}

export default function* rootSaga() {
  yield all([
    helloSaga(),
    watchIncrementAsync()
  ])
}